home *** CD-ROM | disk | FTP | other *** search
/ Holt Researcher: American History / Holt Researcher: American History.iso / pc / modules / results.dxr / 00016_folder title bar button.ls < prev    next >
Encoding:
Text File  |  2000-01-31  |  1.2 KB  |  43 lines

  1. property ancestor
  2.  
  3. on new me, buttonName, castName, theChannel, theStageLoc, descendant
  4.   if objectp(descendant) then
  5.     ancestor = new(script("generic button"), buttonName, castName, theChannel, theStageLoc, descendant)
  6.   else
  7.     ancestor = new(script("generic button"), buttonName, castName, theChannel, theStageLoc, me)
  8.   end if
  9.   return me
  10. end
  11.  
  12. on performFunction me
  13.   global gResultsClassObj
  14.   tell the stage
  15.     playSFX(5)
  16.   end tell
  17.   txtObj = new(xtra("fileio"))
  18.   if not objectp(txtObj) then
  19.     alert("Couldn't open FILEIO Xtra.")
  20.   else
  21.     if the machineType <> 256 then
  22.     else
  23.       setFilterMask(txtObj, "All Files,*.*")
  24.     end if
  25.     pathAndFile = displayOpen(txtObj)
  26.     updateStage()
  27.   end if
  28.   txtObj = 0
  29.   if not voidp(pathAndFile) and (pathAndFile <> EMPTY) then
  30.     fileContents = readTextFile(pathAndFile)
  31.     if line 1 of fileContents <> "{RESULTS}" then
  32.       alert("That file does not contain results data.")
  33.     else
  34.       delete line 1 of fileContents
  35.       last = the number of lines in fileContents
  36.       criteria = line 1 to 3 of fileContents
  37.       hitList = value(line 4 of fileContents)
  38.       titles = line 5 to last of fileContents
  39.       setSearchResultsList(titles, hitList, criteria)
  40.     end if
  41.   end if
  42. end
  43.